package com.allen.workflow.listener.task;

import lombok.Data;
import org.camunda.bpm.engine.delegate.DelegateTask;

import java.util.Map;

/**
 * @program: spring-boot-demo
 * @className WorkTask
 * @description:
 * @author: zp
 * @create: 2024-08-16 14:37
 * @Version 1.0
 **/
@Data
public class WorkTask {

    private final DelegateTask delegateTask;
    private final String taskId;
    private final String taskName;
    private final String eventName;
    private final String assignee;
    private final Map<String, Object> variables;

    public WorkTask(DelegateTask delegateTask){
        this.delegateTask = delegateTask;
        this.taskId = delegateTask.getId();
        this.taskName = delegateTask.getName();
        this.eventName = delegateTask.getEventName();
        this.assignee = delegateTask.getAssignee();
        this.variables = delegateTask.getVariables();
    }
}
